package com.sunnada.edu.business.contracTemplate.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sunnada.edu.system.pub.dao.BaseDaoImpl;

@Repository
public class ContracTemplateDaoImpl extends BaseDaoImpl implements ContracTemplateDao {

	@Override
	public int getContracTemplateCots(HashMap<String, String> params) {
		List list = selectList("contracTemplate_sqlmap.getContracTemplateCots", params);
		if (list != null && list.size() > 0) {
			String cot = ((Map) list.get(0)).get("COT") + "";
			return Integer.valueOf(cot);
		}
		return 0;
	}

	@Override
	public List<?> findContracTemplate(HashMap<String, String> params) {
		return selectList("contracTemplate_sqlmap.findContracTemplate", params);
	}
	@Override
	public int contracTemplateDelete(HashMap<String, String> params) {
		return delete("contracTemplate_sqlmap.contracTemplateDelete", params);
	}

	@Override
	public int contracTemplateAdd(HashMap<String, String> params) {
		return insert("contracTemplate_sqlmap.contracTemplateAdd", params);
	}

	@Override
	public int contracTemplateUpdate(HashMap<String, String> params) {
		return update("contracTemplate_sqlmap.contracTemplateUpdate", params);
	}

	@Override
	public Map contracTemplateById(HashMap<String, String> params) {
		List list = selectList("contracTemplate_sqlmap.contracTemplateById", params);
		if (list != null && list.size() > 0) {
			return (Map) list.get(0);
		}
		return null;
	}
	
}
